package edu.lingnan.house.controller;

import edu.lingnan.house.pojo.TbHouse;
import edu.lingnan.house.service.TbAgentService;
import edu.lingnan.house.service.TbHouseService;
import edu.lingnan.house.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/lin-house")
@CrossOrigin
public class HouseController {

    @Autowired
    private TbHouseService tbHouseService;

    @Autowired
    private TbAgentService tbAgentService;

    @GetMapping("getHouse")
    public Result<TbHouse> House(String houseId){
        //通过houseId查询房子信息
        TbHouse tbHouse = tbHouseService.getById(houseId);
        return new Result<>(200,tbHouse,"ok");
    }

}
